import request from "@/request/request"

// 系统设置 -- 集群接入平台
export default {
    // 集群接入管理-查询
    getClusterListApi() {
        return request("get", "/dataproject/remote_cluster/")
    },

    // 集群接入管理-添加
    appendClusterApi(data) {
        return request("post", "/dataproject/remote_cluster/", data)
    },

    //集群接入管理-更新
    updateClusterApi(id, data) {
        return request("put", `/dataproject/remote_cluster/${id}/`, data)
    },

    //集群接入管理-删除
    deleteClusterApi(id) {
        return request("DELETE", `/dataproject/remote_cluster/${id}/`)
    },

    //设置集群名称-获取
    getClusterNameApi() {
        return request("get", "/configuration/cluster_name/")
    },

    //设置集群名称-编辑
    updateClusterNameApi(data) {
        return request("post", "/configuration/cluster_name/", data)
    },

    //集群接入管理-状态同步
    getclusterStatusApi() {
        return request("get", "/dataproject/remote_cluster/getAllClusterHealth/")
    },

    //复制关系-配置快照数量
    getImageCountApi() {
        return request("put", "/dataproject/mirror_config/getImageMirrorCount/")
    },

    // 复制关系-配置快照数
    appendImageCountApi(data) {
        return request("put", "/dataproject/mirror_config/setImageMirrorCount/", data)
    },

    //认证服务--列表
    getCretificationApi(){
        return request("get", "/oauth/application/")
    },

    //认证服务--查看
    getCretificationDetailApi(id){
        return request("get", `/oauth/application/${id}/`)
    },

    //认证服务--创建
    appendCretificationApi(data){
        return request("post", "/oauth/application/", data)
    },
  
     //认证服务--编辑
     updateCretificationApi(id,data){
        return request("put", `/oauth/application/${id}/`, data)
    },

    //认证服务--删除
    delCretificationApi(id){
        return request("DELETE", `/oauth/application/${id}/`)
    },

    //服务端--获取code（授权）
    getAuthorizeApi(data){
        return request('get', "/oauth/authorize/", data)
    },

    authorizeApi(client_id, response_type, redirect_uri, state_id, data) {
        return request("post", `/oauth/authorize/?client_id=${client_id}&response_type=${response_type}&redirect_uri=${redirect_uri}&state=${state_id}`, data)
      },

}